package com.dragon.modules.yuegou.model.product;

import com.dragon.modules.yuegou.entity.product.StockChangeEntity;
import com.dragon.modules.yuegou.enums.product.StockChangeStockType;
import com.dragon.modules.yuegou.enums.product.StockChangeType;
import io.swagger.annotations.ApiModelProperty;
import org.hibernate.validator.constraints.Length;

import javax.validation.constraints.NotEmpty;
import javax.validation.constraints.NotNull;
import java.time.LocalDateTime;

/**
 * 库存出库入库信息表模型类
 * 
 * @author px
 * @date 2019-04-17 14:44:42
 * @company sgy
 * @version 2.0
 * @see Length 长度限制
 * @see NotNull 对象非空
 * @see NotEmpty 字符串、集合、表、数组非空
 */
public class StockChange extends StockChangeEntity {

	@ApiModelProperty("操作人")
	private String createdName;

	/**
	 * sku名称
	 * */
	@ApiModelProperty("sku名称")
	private String skuName;

	@ApiModelProperty("sku属性")
	private String skuAttrs;
	
	/**
	 * 构造一个空库存出库入库信息表模型对象
	 */
	public StockChange(){
		super();
	}
	
	/**
	 * 依据实体对象的信息构造一个库存出库入库信息表模型对象
	 * 
	 * @param entity 实体对象
	 */
	public StockChange(StockChangeEntity entity){
		super(entity);
	}

	/**
	 * 依据其它对象的信息构造一个库存出库入库信息表模型对象
	 * 
	 * @param other 其它对象
	 */
	public StockChange(StockChange other){
		super(other);
	}

	public String getSkuName() {
		return skuName;
	}

	public void setSkuName(String skuName) {
		this.skuName = skuName;
	}

	public String getSkuAttrs() {
		return skuAttrs;
	}

	public void setSkuAttrs(String skuAttrs) {
		this.skuAttrs = skuAttrs;
	}

	public String getCreatedName() {
		return createdName;
	}

	public void setCreatedName(String createdName) {
		this.createdName = createdName;
	}

	@Override
	public String getId() {
    	return id;
    }

    /**
	 * 设置
	 * 
	 * @param id 
	 * @return 当前对象
	 */
    public StockChange id(String id) {
    	this.id = id;
    	return this;
    }

	@Override
	public String getSkuId() {
    	return skuId;
    }

    /**
	 * 设置SKUID
	 * 
	 * @param skuId SKUID
	 * @return 当前对象
	 */
    public StockChange skuId(String skuId) {
    	this.skuId = skuId;
    	return this;
    }

	@Override
	public Integer getTotal() {
    	return total;
    }

    /**
	 * 设置总量
	 * 
	 * @param total 总量
	 * @return 当前对象
	 */
    public StockChange total(Integer total) {
    	this.total = total;
    	return this;
    }

	@Override
	public Integer getStock() {
    	return stock;
    }

    /**
	 * 设置库存
	 * 
	 * @param stock 库存
	 * @return 当前对象
	 */
    public StockChange stock(Integer stock) {
    	this.stock = stock;
    	return this;
    }

	@Override
	public Integer getChange() {
    	return change;
    }

    /**
	 * 设置变化值
	 * 
	 * @param change 变化值
	 * @return 当前对象
	 */
    public StockChange change(Integer change) {
    	this.change = change;
    	return this;
    }

	@Override
	public StockChangeStockType getStockType() {
    	return stockType;
    }

    /**
	 * 设置[枚举]库存类型：0-入库-IN、1-出库-OUT
	 * 
	 * @param stockType [枚举]库存类型：0-入库-IN、1-出库-OUT
	 * @return 当前对象
	 */
    public StockChange stockType(StockChangeStockType stockType) {
    	this.stockType = stockType;
    	return this;
    }

	@Override
	public StockChangeType getType() {
    	return type;
    }

    /**
	 * 设置[枚举]库存变更类型：0-下单-ORDER、1-取消订单-CANCEL、2-新增商品-INIT、3-后台编辑-EDIT、4-到家商品拒绝接单-REFUSE
	 * 
	 * @param type [枚举]库存变更类型：0-下单-ORDER、1-取消订单-CANCEL、2-新增商品-INIT、3-后台编辑-EDIT、4-到家商品拒绝接单-REFUSE
	 * @return 当前对象
	 */
    public StockChange type(StockChangeType type) {
    	this.type = type;
    	return this;
    }

	@Override
	public String getCreatedBy() {
    	return createdBy;
    }

    /**
	 * 设置创建人ID
	 * 
	 * @param createdBy 创建人ID
	 * @return 当前对象
	 */
    public StockChange createdBy(String createdBy) {
    	this.createdBy = createdBy;
    	return this;
    }

	@Override
	public LocalDateTime getCreatedTime() {
    	return createdTime;
    }

    /**
	 * 设置创建时间
	 * 
	 * @param createdTime 创建时间
	 * @return 当前对象
	 */
    public StockChange createdTime(LocalDateTime createdTime) {
    	this.createdTime = createdTime;
    	return this;
    }
}
